package com.yanmaohu.yulia.bean;

import java.util.List;

/**
 * @author Bright Lee
 */
public final class CommonSequenceGeneratorOptions implements SequenceGeneratorOption {

    private int beginIndex;
    private int endIndex;
    private List<CommonSequenceGeneratorOption> commonSequenceGeneratorOptionList;

    public CommonSequenceGeneratorOptions(List<CommonSequenceGeneratorOption> commonSequenceGeneratorOptionList) {
        this.beginIndex = commonSequenceGeneratorOptionList.get(0).getBeginIndex();
        this.endIndex = commonSequenceGeneratorOptionList.get(commonSequenceGeneratorOptionList.size() - 1).getEndIndex();
        this.commonSequenceGeneratorOptionList = commonSequenceGeneratorOptionList;
    }

    @Override
    public int getBeginIndex() {
        return beginIndex;
    }

    @Override
    public int getEndIndex() {
        return endIndex;
    }

    public int size() {
        return commonSequenceGeneratorOptionList.size();
    }

    public CommonSequenceGeneratorOption get(int index) {
        return commonSequenceGeneratorOptionList.get(index);
    }

}
